﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BingVis.SilverlightClient.Common;
using System.IO;

namespace BingVis.SilverlightClient.GoogleTransit
{
    public class DirectoryFileLoader : IFileLoader
    {
        private string _dirPath;

        #region IFileLoader Members

        public IEnumerable<IGTFSFile> Files
        {
            get
            {
                foreach (var fileName in Directory.GetFiles(_dirPath))
                {
                    yield return new GTFSFile(fileName);
                }
            }
        }

        #endregion

        public DirectoryFileLoader(string dirPath)
        {
            _dirPath = dirPath;
        }
    }
}
